<{assign var="tpl_page_title" value="订单支付"}>
<{include file="mobile/block/header.html"}>
<section id="" class="page_center_box">
	<h2 class="pd_lt">订单信息</h2>
	<div class="pd10 payBox mb10 lh30">
		<p>订单号：<{$order.order_no}></p>
		<p>收货人：<{$order.contact}></p>
		<p>电话：<{$order.mobile}></p>
		<p>地址：<{$order.addr}></p>
	</div>
	<div class="pd10"> <a href="<{link ctl='mobile/trade/order:detail' arg0=$order.order_no}>" class="btn fukbtn_full">查看订单</a> </div>
	<div class="fuk_btn">
		<div class="all_price mb10"> <span class="lt">应付金额：</span><span class="rt pointcl">￥<{$order.amount}></span> </div>
	</div>
	<form action="<{$CONFIG.site.siteurl}>/index.php?ctl=mobile/trade/payment&act=order" id="payment-form" method="post">
		<input type="hidden" name="order_no" value="<{$order.order_no}>" />
		<input type="hidden" id='packet' name="packet" value="<{$max_packet['id']}>" />
		<h2 class="pd_lt">选择支付方式</h2>
		<div class="payBox order_menu">
			<input type="hidden" name="code" id="payment_code" value=""/>
			<{foreach $pay_list as $pay}>
			<{if $pay.status==1}> <a href="###" class="pay_a" data-value="<{$pay.payment}>">
			<p><span class="fl"><{$pay.title}></span><span class="fr count_ico choose_ico"></span></p>
			</a> <{/if}>
			<{/foreach}> </div>
		<{if $max_packet}>
		<div class="order_youhuiquan">
			<div class="fl">
				<select onchange="chang(this.value)">
					<{foreach $packet as $item}> <option  value="<{$item.id}>" <{if $packet_id == $item.id}> selected="selected" <{/if}> >满<{$item['man']}>元，减<{$item['price']}>元
					</option>
					<{/foreach}>
				</select>
			</div>
			<div class="fr"> 满<font class="pointcl"><{$max_packet['man']}></font>元，减<font class="pointcl"><{$max_packet['price']}></font>元 </div>
			<div class="clear"></div>
		</div>
		<{/if}>
		<div class="pd10" id='pay'>
			<button class="long_btn">确认支付</button>
		</div>
		<div class="pd10" id='wxpay' style = 'display:none;'> <a href="<{link ctl='mobile/trade/payment:order' arg0='wxpay' arg1=$order.order_no arg2=$max_packet.id http='ajax'}>" mini-width='180' mini-load="扫描二维码" class="long_btn">确认支付</a> </div>
	</form>
	<script>
	$(document).ready(function(){
		$('.order_menu a.pay_a').click(function(){
			$('.order_menu a.pay_a').find('span.choose_ico').hide();
			$(this).find('span.choose_ico').css('display','block');
			$("#payment_code").val($(this).attr("data-value"));
			var code = $("input[name='code']:checked").val();
			 if(code == 'wxpay'){
				$("#wxpay").css('display','block'); 
				$("#pay").css('display','none');
			 }else{
				$("#wxpay").css('display','none'); 
				$("#pay").css('display','block');
			 }
		});
		$('.order_menu a.pay_a').eq(0).trigger("click");
		
		var code = $('.order_menu a.pay_a').attr("data-value");
		 if(code == 'wxpay'){
			$("#wxpay").css('display','block'); 
			$("#pay").css('display','none');
		 }else{
			$("#wxpay").css('display','none'); 
			$("#pay").css('display','block');
		 }
	});
</script> 
	<script type="text/javascript">
	function chang(val)
	{
		var url = "<{link ctl='mobile/trade/order:payment'  arg0=$order.order_no arg1='#val#' http='base'}>";
		window.location.href = url.replace("#val#", val);
	}
</script> 
</section>
<{include file="mobile/block/sheader.html"}>
</body></html>